﻿using Entity.WMS.DTO.WarehouseInventory;
using Entity.WMS.View.WarehouseInventory;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Service.WMS;

namespace AnQinManagermentBackendAPI.Controller.WMS
{
    /// <summary>
    /// 仓库库存表
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    [Authorize]
    public class WarehouseInventoryController : ControllerBase
    {
        /**
         * 仓库库存业务接口
         */
        private readonly WarehouseInventoryService _warehouseInventoryService;

        /**
         * 构造函数注入
         */
        public WarehouseInventoryController(WarehouseInventoryService warehouseInventoryService)
        {
            _warehouseInventoryService = warehouseInventoryService;
        }

        /// <summary>
        /// 获取仓库库存列表
        /// </summary>
        /// <param name="warehouseInventorySearchDTO"></param>
        [HttpGet]
        [ProducesResponseType(typeof(WarehouseInventoryView), 200)]
        public async Task<IActionResult> GetWarehouseOtherInList([FromQuery] WarehouseInventorySearchDTO warehouseInventorySearchDTO)
        {
            var response = await _warehouseInventoryService.GetWarehouseInventoryList(warehouseInventorySearchDTO);
            return StatusCode(response.Status, response);
        }
    }
}
